<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

//^ab
//cd$
//    var reg = /^(ab|cd)$/g;
//    var s = 'abcd';

    var reg = /(za|fa)ood/;
//    var s = 'zaood'
    var s = 'faood'



    var r = s.match(reg);
    console.log(r);
</script>
</body>
</html>